<?php
	include 'ZionHeader.inc';
?>

<html>
<body>
<h1>Bookmarked Announcement!</h1>

<?php
$VehicleID = $_POST['ID'];

$name = $_SESSION['UName']; // retrieve user ID
$AccountType = $_SESSION['AType'];

include 'DatabaseConnect.inc';

//We take $VehicleID and match it with the respective ID for the announcement. 
//Once we have that, we then store that announcement ID into Bookmark table. 

$query = "SELECT * FROM Announcement WHERE vehicle_ID = '$VehicleID'";
$result = mysql_query($query);
$row2 = mysql_fetch_array($result);

$announcementID = $row2['ID'];

$time = date(DATE_RFC822);

//$query = "INSERT INTO  Announcement ( Timestamp, vehicle_ID, userID) Values ('$time', '".$row['ID']."', '$username')";
$query = "INSERT INTO Bookmark ( idBookmark, Timestamp, User_LoginID, announceID) Values ('','$time', '$name', '$announcementID')";

mysql_query($query);

mysql_close();

?>

<h1>Announcement has been bookmarked!</h1>
<br />
<br />
<a href="announcement.php">Return To Index</a>


</body>
</html>
